import java.util.ArrayList;

public class ShoppingCart {
    private final ArrayList<Product> products;

    public ShoppingCart() {
        this.products = new ArrayList<>();
    }

    // 添加商品到购物车
    public void addProduct(Product product) {
        products.add(product);
    }

    // 从购物车中移除商品
    public void remove(Product product) {
        products.remove(product);
    }

    // 获取购物车中的商品列表
    public ArrayList<Product> getProducts() {
        return products;
    }
}